Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Una pregunta sobre importar datos desde Cobol

119 views
Skip to first unread message

Eduardo Gamboa Pino

unread,
Dec 11, 2009, 9:08:55 AM12/11/09
to
Buenos D�as

Mi inquietud es la siguiente:

Existe alg�n m�todo, programa, utilidad, que me permita accesar unos
archivos hechos con acucobol GT y poder consultarlos desde Visual FoxPro, de
pronto este tema ya ha sido tratado, pero he buscado en internet y no he
encontrado respuesta.


De antemano gracias por la atenci�n prestada

Cordialmente

Eduardo Le�n Gamboa Pino
Sistemas
COBRETEC

Joan Mir

unread,
Dec 11, 2009, 10:55:53 AM12/11/09
to
Hola,

Puedes acceder facilmente a los archivos de Acucobol mediante su driver
ODBC.

Un saludo.

"Eduardo Gamboa Pino" <elg...@hotmail.com> escribi� en el mensaje de
noticias news:1981B15B-C281-40A1...@microsoft.com...

Eduardo Gamboa Pino

unread,
Dec 11, 2009, 11:42:50 AM12/11/09
to
he ahi el detalle, al ser una aplicacion comercial, no lo encuentro o como
se llama, por que de verdad busco y no


"Joan Mir" <jmi...@hotmail.com> escribi� en el mensaje de
noticias:D583BC67-34C8-4FE4...@microsoft.com...

Enrique Mu�iz

unread,
Dec 11, 2009, 12:54:44 PM12/11/09
to
Revisa este enlace

http://www.torrentdownloads.net/searches/acuodbc%206%200

--
Enrique Mu�iz
Departamento Desarrollo
Servicios & Sistemas
---------------------------------------


"Eduardo Gamboa Pino" <elg...@hotmail.com> escribi� en el mensaje

news:6A87DB93-F688-4CBB...@microsoft.com...

josepe

unread,
Dec 11, 2009, 12:56:03 PM12/11/09
to
Estos se�ores tienen algo al respecto.
http://www.cobolproducts.com/
http://www.siber.com/enterprise/cobol

--------------
Cobol Data-Viewer: View and Convert Cobol
Data Files to Flat Text Files (CSV), dBase DBF,
MS Access, SQL databases

Data-Viewer can read a Cobol data file and convert it
non-Cobol formats such as CSV, DBF, Oracle, Excel,
etc. This is what DataViewer can do:

Read file with Known Record Layout. Record layout of
the data file is known to you. You have an
*.FDD file file that contains record layout info and
a link to the actual data file. Use "File. Open"
command to open the *.FDD file.

Data-Viewer recognizes these Cobol data file formats:
* MF: MicroFocus Cobol,
* MFSCO: MicroFocus SCO Cobol,
* MF8: MicroFocus Cobol IDXFORMAT8
* VIS: MicroFocus Visual Cobol,
* RM: RM/RM85 Cobol
* FSC: FSC RMKF Cobol
* ACU: AcuCobol
* SEQ: Sequential Cobol data files,
* Your file format: ask us to add your file format,
if Data-Viewer does not recognize it. It usually takes
1-2 weeks.

Extract Record Layout from Cobol Program. You can
convert Cobol copybook (include file) that
contains an FD statement with file`s record layout by
using "File. Load Layout from Copybook"
command.

Read file with Unknown Record Layout. You do not know
what the record layout of your data file
is. Use "File. Open" command to open the data file
itself and Data-Viewer will guess the record layout
for you.

Edit Record Layout. You can edit record layout --
move, split, merge fields. When you are done,
click the Apply button and the new layout will be
used to re-read the data file. Guessed layout usually is
not fully correct, so use these layoit editing
capabilities to improve it.

Export the data to non-Cobol format. You can export
opened data files into:
* Comma-Separated Values (CSV) format,
* dBase DBF format,
* any format supported by ODBC: Excel, SQL Server,
Oracle, etc.

Evaluate DataViewer

Trial Version Limitations. These limitations are designed
to show you that Data-Viewer can read your data
files and "massage" their layout but not let you perform
the actual conversion without paying for DataViewer.
* Files cannot be exported.
* Record layouts cannot be saved.
* Record field lengths, offsets, pictures, etc are not shown.
* Some commands that rely on explicit lengths and offsets
being known (Split) do not work.

Proceed to Cobol Data File Readers Evaluation. You will
return here after the download.

Run DataViewer Evaluation

Reading MF Data File with Unknown Layout. Start DataViewer
and open file "Program Files\ Siber
Systems\ DataViewer\ Sample Files\file-mf.dat". DataViewer
will perform data-guessing and it will show first
100 records of file-mf.dat.

Reading MF Data File with Known Layout. Start DataViewer
and open file "Sample Files\file-mf.fdd".
This file contains a link to the actual data file
file-mf.dat and to text file file-mf_out-rec.rdd that contains record
layout.

How To Use Data-Viewer

This is a "How-To" Data-Viewer Manual where we tell you
how to achieve your project goals using
Data-Viewer.

Start: Open Data File. Select File. Open. Browse for data
file that you want to open and click OK.
Data-Viewer will guess record layout of this data file and
open it. Even if you have record layout in a
copybook, you should start with this step.

Load Record Layout from Cobol Copybook. If you have a
record layout for this data file in a Cobol
copybook (Cobol equivalent of C include file) then load
this layout into Data-Viewer by selecting "File. Load
Layout from Copybook".

In the dialog that appears specify the copybook name
(click "..." to browse for it) and click Go. Data-Viewer
will run CBL2FDD tool that will convert this copybook to
an *.FDD file that stores file parameters and record
layout for use by Data-Viewer and other Data Readers.

Check the parsing results for syntax errors and correct
them. If copybook is parsed correctly, click the Apply
button and parsed record layout will be applied to the
currently loaded data file.

Copybook is a text file in Cobol that looks like this:

01 out-rec.
05 out-key pic 9(9) binary.
05 out-s-comp-3 pic s9(9) comp-3.
05 out-s-comp-5 pic s9(9) comp-5.
05 out-comp-5 pic 9(11) comp-5.
05 out-comp-3 pic 9(9) comp-3.
05 out-s-binary pic s9(9) binary.
05 fs-d-result pic 9(9).99 display.
05 fs-result pic 9(9)v99 display.
05 fs-result-breakdown redefines fs-result.
10 fs-result-int-part pic 9(9).
10 fs-result-fract-part pic 99.
05 fs-display pic x(8).
05 out-key-al pic 9(12) sync binary.

Copybook must start with a 01 data item definition. It
cannot start with an FD statement. Copybooks file
names usually have extensions CPY, CBL, COB, but actually
any extension can be used or no extension at all.

CBL2FDD generates this proxy main program that includes
your copybook by reference. Then it parses this
complete Cobol program and extractrs record descriptor
from it. Your copybook together with this program
must form a syntactically correct Cobol program. CBL2FDD
can also parse complete Cobol programs (not
just copybooks).

IDENTIFICATION DIVISION.
PROGRAM-ID. DUMMYPRG.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT file-name
ASSIGN TO data-file-path
ORGANIZATION IS organization
DATA DIVISION.
FILE SECTION.
FD file-name.
COPY "copybook-file-name".
PROCEDURE DIVISION.
100-start.

Load Record Layout from Cobol Program. If in the Cbl2Fdd
dialog you uncheck the "Input File is
Copybook" box then Cbl2Fdd will parse a complete Cobol
program and it will produce FDD files for all files
that are read or written in this porgram.

Use Data File Indices to Order Records. By default
Data-Viewer shows records in physical order. To
make it read records in the order of an index, click File.
Select Index, select one of the offered indices and
click OK. Data-Viewer will read records in the order of
the selected index. Index fields will be highlighted in
green.

View Data Fields as Text and/or Hex Dump.
Select View. As Hex to show file data in Hexadecimal format.
Select View. As Text to show file data in ASCII text format.

Show/Hide Field Margins.
Select View. Show Field Margins to indicate where the
field value ends by a "|" character.

Edit Record Layout. Use command in the Data menu (they
also appear as button on the right) to edit the
record layout of the loaded Cobol data file. See the
"Editing Commands" Chapter below for details. Click the
"Apply" button to cause reloading of the data file using
the new layout.

Save Record Layout. Once your Cobol data looks good, it is
time to save the edited record layout. Select
"File. Save Layout As..." and specify the name of the
*.FDD file to which layout is saved. The best approach is
to have the layout file name the same as data file name
but with a different suffix "FDD".

Load File using Saved Record Layout. When you need to open
a data file using saved layout, open the
*.FDD file that you saved not the data file. If you try to
open a data file for which you have an FDD file,
RoboForm will offer to offer the file using the saved FD
layout instead.

Export (Convert) Data to External Formats. Select "File.
Export Data" and specify the name of the output
file (click "..." to browse for the file). Click the
"Export" to start the export process.

You can set these options when exporting:
- Number of records to export.
- Field separator character (comma by default).
- Trim Text Data option.
- Option to Add field names as a first line of the
exported file.

Data2Flat: Fast Converter to Flat (CSV) files. Data-Viewer
also provides a GUI interface to our fast
command-line converter Data2Flat. Invoke it using
"Data2Flat: Fast File Converter". You can save the
command line that start this converter and use it in a batch.

Data2Flat converts Cobol data file to flat
(comma-separated values) data file. In the resulting flat file every
record occupies exactly one line and data items on the
line are separated by separator character (usually
comma). Flat file contains text representation of all data
items in a file. Flat files can be used to load data into
Microsoft Excel and into most modern databases.

Data2Dbf: Fast Converter to dBase IV DBF files.
Data-Viewer also provides a GUI interface to our fast
command-line converters Data2Dbf. Invoke it using
"Data2Dbf: Fast File Converter".

Data2Dbf converts Cobol data file to dBase IV DBF file.
You can import DBF files into Microsoft Excel,
Microsoft Access and other spreadsheet, reporting, and
database software.

Filter Records.
Allows to set a filter to see only records that satisfy a
user-defined condition. Used when working with files that
contain records with different layouts (records created
with REDEFINES in copybook). Select Data. Filter,
click Use Filter and specify a condition in which a field
is compared to a constant. Only the records that satify
this condition will be shown.

Editing Record Layout in Data-Viewer

In this Chapter we dive into details of editing the record
layout.

* View and Edit Field Properties.
Once data file is open, you can view and edit all
properties of any of fields. When you select the field by
clicking its name, the properties of this field are put
into mini-windows below field name and you can edit these
properties there. The following properties are available:
- offset in bytes,
- length in bytes,
- position of decimal point (comma),
- picture,
- usage,
- sign.
If you want to see offset, length and usage of all fields
at once, select View. Record Layout.

* Apply Changes.
If you hit Apply button, the data file will be re-read
using the changed field properties.

* Undo Changes.
If you hit Undo button, the latest set of changes to file
layout will be undone. Undo can be hit several times, so
the entire sequence of changes since the original load can
be undone.

* Layout Manipulation Commands.
Copy. Create a copy of the selected field, add it after
selected field.
Delete. Delete the selected field.
Merge. Merge the selected field with a field that comes
after it.
Split. Split the selected field into two fields.

Single Field Guess.
If you click Guess button (or select "Data. Guess Field"),
the selected field will be data-guessed based on its
new length and offset, that is its usage, picture and sign
will be computed, but not the lenght and offset. Use this
command to data-guess fields whose length and/or offset
were manually changed.

Compute Picture.
If you click Picture button (or select "Data. Compute
Picture"), the Picture property will be computed for the
selected field to reflect its changed length. Use this
command to correct pictures of fields whose length and/or
offset were manually changed.

Data2Flat and Data2Dbf options

These are Data2Flat and Data2Dbf command line options:

*** Data2Flat ***

-help=boolean (now: -OFF-, can be -help or -no-help)
Print help
-progress=boolean (now: -OFF-, can be -progress or
-no-progress)
Show conversion progress
-show-descr=boolean (now: -OFF-, can be -show-descr or
-no-show-descr)
Show the loaded FDD and RDD descriptor info
-out-file=string (now: "")
Output file name
-separator=string (now: ",")
String used to separate data fields
-quote=string (now: "")
Character used to quote character data
-max-recs=number (now: 0)
Number of records to convert (0=all)
-dump-items=string list (now: )
List of fields to be dumped in the format from
-group-format
-dump-format=hex|alpha (now: hex)
Format to be used for data items dump
-trim=string list (now: "+ALL")
Fields to be trimmed: ALL | ALLTEXT | ALLNUM |
field-list
-first-line-names=boolean (now: -OFF-, can be
-first-line-names or -no-first-line-names)
Export field names to first line of FLAT file
-filter=string list (now: )
Filter expresion - refer to the documentation

-europe-date=boolean (now: -OFF-, can be -europe-date or
-no-europe-date)
Print dates in DD.MM.YYYY form, rather than MM/DD/YYYY


*** Data2Dbf ***

-help=boolean (now: -OFF-, can be -help or -no-help)
Print help
-v=boolean (now: -OFF-, can be -v or -no-v)
Print version
-progress=boolean (now: -OFF-, can be -progress or
-no-progress)
Show conversion progress
-show-descr=boolean (now: -OFF-, can be -show-descr or
-no-show-descr)
Show the loaded FDD and RDD descriptor info
-log=boolean (now: -OFF-, can be -log or -no-log)
Enable logging
-memos=string list (now: )
List of fields to be converted to MEMOs (+ALL
means all text fields)
-out-file=string (now: "")
Output file name


Filter Specification in -filter.

User may specify filter as follows:

-filter=field-name-1,oper-1,value-1,field-name-2,oper-2,value-2
All these expressions will be ANDed.

Operations available (CS stands for case-sensitive):

non CS | CS | meaning
-------+-----+-------------
eq :eq ==
ne :ne !=
gt :gt >
lt :lt <
le :le <=
ge :ge >=

Currently there is a limitation of 2 fields in a filter.

Advanced Record Layout Issues

Here we describe format of the FDD/RDD file that encodes
record layout. Most of the time you do not need
to know details of the FDD/RDD file format and the file is
encrypted anyway in the Trial version. However
advanced users will find this Reference document useful.

OCCURS issues

Data item: name OCCURS n TIMES PIC p USAGE u is presented
both:
- as n items with names name_1, name_2, ..., name_n, each
having "PIC p USAGE u" format,
- as a concatenation of n items that has "PIC p(n) USAGE
u" format, the group item is commented out in RDD
file, though, but you can uncomment it if need be

File Descriptor (FDD) FDD file format

This document describes format of FDD file.

FDD file describes the Cobol data file.
It contains all data that is needed to read the file.

FDD file usually has *.FDD extension.

FDD file format is simple and
it is easily readable by computer programs.

FDD file consists of lines.
Line can be of any length.
There is no line continuation character,
so lines cannot be broken.

Lines that start with '#' or '*' or '/'
are comment lines and as such they are ignored.

Non-comment lines consist of fields.
Fields are separated by one or more spaces (' ') or TABs
('\t').
Each field consists of non-space characters.

First field of a line is a keyword that defines
the interpretation of the remainder of the line.
Every keyword starts a command.
All commands take exactly one line.

The following commands are available:

* FILE <cobol-file-name>
Specifies file-name as it appears in the Cobol
program in FD and SELECT statements.
This is here for informational purposes only.

* RDDFILE <file-name>
Specifies name of the RDD file that describes structure
of the file record.
If <file-name> contains spaces or special characters,
it must be enclosed in single or double quotes.
If <file-name> is not absolute, then it is relative
to the directory of FDD file that contains this RDDFILE
command.
You may have several RDD files defined for one data record.

* DATAFILE <file-name>
Specifies name of the Cobol data file that contains the
actual data.
If <file-name> contains spaces or special characters,
it must be enclosed in single or double quotes.
If <file-name> is not absolute, then it is relative
to the directory of FDD file that contains this DATAFILE
command.
Exactly one DATAFILE command must be present.

* ORGANIZATION <org-type>
Specifies data file organization.
<org-type> can be one of the following:
SEQUENTIAL ORGANIZATION IS SEQUENTIAL
LINESEQUENTIAL ORGANIZATION IS LINE SEQUENTIAL
BINARYSEQUENTIAL ORGANIZATION IS BINARY SEQUENTIAL
INDEXED ORGANIZATION IS INDEXED
RELATIVE ORGANIZATION IS RELATIVE

* ACCESSMODE <am-type>
Specifies data file access mode.
<am-type> can be one of the following:
SEQUENTIAL ACCESS MODE IS SEQUENTIAL
DYNAMIC ACCESS MODE IS DYNAMIC
RANDOM ACCESS MODE IS RANDOM

* FILEFORMAT <format-type>
Specifies vendor-specific physical format of the data file.
The following phycal formats are available:
DEFAULTFILEFORMAT default format for the program that
uses FDD file.
If no file format is specified,
then DEFAULTFILEFORMAT is assumed.
FSC Fujitsu data file
MF Micro Focus data file
ACU AcuCobol data file
RM Ryan McFarland data file
MFSCO Micro Focus on SCO UNIX data file.
Create FDD/RDD files for SCO using
-lang=mf and
then manually change MF to MFSCO in
FDD file.

Record Descriptor (RDD) file format

This document describes format of RDD file.

RDD file describes the exact format of
the Cobol data record (01 or FD record description).

RDD file usually has *.RDD extension
but it can be inlined in FDD file.

RDD file format is simple and
it is easily readable by computer programs.

RDD file consists of lines.
Line can be of any length.
There is no line continuation character,
so lines cannot be broken.

Lines that start with "#" or "*" or "/"
are comment lines and as such they are ignored.

Non-comment lines consist of fields.
Fields are separated by one or more spaces (" ") or TABs
("\t").
Each field consists of non-space characters.

If a particular field has no value (is empty),
it is represented by "@" character.

First field of a line is a keyword that defines
the interpretation of the remainder of the line.

The following line types are available:


* DATA line defines data item.
This is the most popular line in RDD file.

DATA <log-level> <phys-level> <name> <category>
<usage> <sign> <occurs-from> <occurs-to>
<offset> <bit-offset> <length> <picture> [<date-picture>]
(all these <> items appear on one line in RDD file)

<log-level> is logical level of the item in the hierarchy
of data items.
Starts at 0 and is incremented by 1. Can be 0, 1, 2, 3, 4, ...

<phys-level> is physical level of the item as specified in
the Cobol program.
Has exactly 2 numeric decimal characters.
Can be: 01, 02, ..., 05, 06, ..., 10, ..., 49.

<name> is the name of the data item.
Conforms to Cobol rules for user-defined names.
If name is empty (@ character), then
this is FILLER data item.

<category> is effective category of the data item.
It can have on the following values:
G group item
I index
P pointer
PP procedure pointer
A alphabetic
N numeric
AN alphanumeric
AE alphanumeric edited
NE numeric edited
IF internal float
EF external float
B bit
J national (usually Japanese)
JE national edited

<usage> is effective USAGE clause of the data item.
Effective usage means: If this item has no usage clause, then
the usage clause of the nearest ancestor of the data item
is used.
If none of ancestors has usage clause, then USAGE DISPLAY
is used.
Usage can be one of the following:

D or DF DISPLAY by Fujitsu
DM DISPLAY by MicroFocus
DR DISPLAY by RyanMcFarland and AcuCobol
D1 DISPLAY-1 (DBCS)
DW DISPLAY-WS
CR RM COMP or ACU COMP-2: DISPLAY-like
(display items differ in SIGN SEPARATE rpresentation)

C BINARY or COMP
0 COMP-0: same as COMP, used in MS
1R COMP-1 by RM and ACU: variation of BINARY
4 COMP-4: same as BINARY
5 COMP-5: variation of BINARY)
6R COMP-6: RM binary
X COMP-X: variation of BINARY)

PD COMP-3 or PACKED-DECIMAL
3A COMP-3: variation by ACU

1 COMP-1: internal single float
2 COMP-2: internal double float

I INDEX
PT POINTER
PP PROCEDURE-POINTER

B BIT (FSC)


On DM, DJ and DR: D (generic DISPLAY) will work in place
of DM, DJ, and DR
most of the time and you do not need to specify DM, DJ or DR.
However, if you link fields in Data2Cr, then the actual
DM, DJ or DR
specifiers must be used.
cbl2fdd generates these specifiers based on the value of
-lang option.

<sign> is effective SIGN clause of the data item.
It can be one of the following:
L SIGN IS LEADING
LS SIGN IS LEADING SEPARATE
LE EBCDIC sign LEADING
T SIGN IS TRAILING
TS SIGN IS TRAILING SEPARATE
TE EBCDIC sign TRAILING
@ no sign clause

<occurs-from> <occurs-to> describes the OCCURS clause of
the data item:
@ @ no OCCURS clause
<n1> @ OCCURS <n1> TIMES
<n1> <n2> OCCURS <n1> TO <n2> TIMES DEPENDING
ON ...


<offset> is decimal number that encodes
byte offset of this data item from the start of the record.
Can be 0, 1, 2, and up.

<bit-offset> is decimal number that encodes
bit offset of this data item from the start of the byte
designated in <offset>. Can be not 0 only for BIT items.
Thus <full-bit-offset> = <offset>*8 + <bit-offset>.

<length> is decimal number that encodes
length of this data item in bytes.

For BIT items <length> is is also in bytes.
The length of BIT item in bits is equal
to the length of unrolled picture string
of the item.

<picture> is PICTURE clause character string.


<date-picture>, if it is present, tells the systems that
this data item contains date and/or time and it gives
the format of date/time presentation.

Using this format, the system parses the date/time data item
and stores it internally as a date/time item, so that
at output time date/time-specific formatting can be applied
to this data item.

<date-picture> can be present only in numeric and
numeric-edited data items.
The number that represents date/time is parsed by the system
according to the format specified in <date-picture>.

<date-picture> can contain the following substrings:

YY 2-digit year
YYYY 4-digit year
MM 2-digit month: " 1", "01", " 2", "02", ..., "11",
"12"
DD 2-digit day: " 1", "01", " 2", "02", ..., "30",
"31"
HH 2-digit hour: "00", " 0", " ", " 1", "01", ...,
"23"
NN 2-digit minute: "00", "01", ..., "59"
SS 2-digit second: "00", "01", ..., "59"
B Unused position

All characters used for separating different time
components ("/" ":" "," ".")
are removed from the the data item before analyzing it using
this template.

That is, if you have numeric-edited data item which
stores date time as "98/12/31 23:59:59", then it
is turned into numeric data item 981231235959
you should use <date-picture> YYMMDDHHNNSS
to recognize this number as date-time.


* DECIMALPOINT line defines a character used to represent
decimal point
for numeric edited data items.
DECIMALPOINT <COMMA | PERIOD>
If this line is omitted, "DECIMALPOINT PERIOD" assumed.


* CURRENCYCHAR line defines a character used as currency
symbol.
CURRENCYCHAR <char>
If this line id omitted, CURRENCYCHAR "$" assumed.


* ALPHABET line defines alphabet used for file. It may be
EBCDIC or ASCII.
If this line is ommitted, assumed alphabet is ASCII.

* APPLIED_TO may be optionally specified in ALPHABET line
after alphabet
definition. Valid values are ALL and DISPLAY_ONLY. If
"APPLIED_TO ALL"
specified, all data read from file should be converted
from file alphabet
(some compilers like MicroFocus allow CODE-SET keyword for
non-DISPLAY
data items). "APPLIED_TO DISPLAY_ONLY" (the default) means
that alphabet
conversion must be applied to data items whose usage is
DISPLAY.


* RECORDLENGTH line defines fixed (minimal) record length.

RECORDLENGTH <nReclen>
<nReclen> is fixed record length.


* MAXRECORDLENGTH line defines maximal record length.
Maximal record length is more than fixed record length in
case of
variable record length (OCCURS..DEPENDING ON present in
record definition).

MAXRECORDLENGTH <nMaxreclen>
<nMaxreclen> is maximal record length.

Real record length lies between nReclen and nMaxreclen.

josepe

unread,
Dec 11, 2009, 1:10:32 PM12/11/09
to
En 2003 poste� una rutina que era util para migrar la data desde Cobol
hacia ASCII. Pero eso implica que conoces la estructura de la data
secuencial en Cobol.

http://groups.google.com.sv/group/microsoft.public.es.vfoxpro/browse_thread/thread/7946e6f47342b8e4/1200b292897385da?hl=es&q=cobol+josepe#1200b292897385da

Esta rutina se hizo para RMCobol-85 y se ejecutaba asi:
runcobol excli
-------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. EXCLI
AUTHOR. JOSEPE
DATE-WRITTEN. ENE/95.
*
* listado DE CLIENTES.
*
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. TI-300.
OBJECT-COMPUTER. TI-300.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PRECLI
ASSIGN TO RANDOM, "PRECLI"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS CLI-KEY
ALTERNATE RECORD KEY IS CLI-KEY1 WITH DUPLICATES.
SELECT PREMAE1 ASSIGN TO RANDOM, "EXCLI.TXT"
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
COPY "PRECLI.FID".
FD PREMAE1
LABEL RECORDS ARE STANDARD.
01 REG-PREMAE1.
03 CLI1-KEY1.
05 CLI1-CLIENTE1 PIC X(02).
05 CLI1-CLIENTE PIC X(04).
03 CLI1-NOMBRE PIC X(25).
03 CLI1-APELLIDO PIC X(25).
03 CLI1-DIRECCION PIC X(55).
03 CLI1-CIUDAD PIC X(4).
03 CLI1-TEL-CASA PIC X(10).
03 CLI1-CIP PIC X(12).
03 CLI1-EXTENDIDA PIC X(15).
03 CLI1-FCH-EXT.
05 CLI1-FCH-EXTD PIC X(02).
05 CLI1-FCH-EXTF1 PIC X.
05 CLI1-FCH-EXTM PIC X(02).
05 CLI1-FCH-EXTF2 PIC X.
05 CLI1-FCH-EXTA PIC X(02).
03 CLI1-FIRMA-SE-LEE PIC X(15).
03 CLI1-EST-CIVIL PIC X(01).
03 CLI1-EDAD PIC X(02).
03 CLI1-FCH-NAC.
05 CLI1-FCH-NACD PIC X(02).
05 CLI1-FCH-NACF1 PIC X.
05 CLI1-FCH-NACM PIC X(02).
05 CLI1-FCH-NACF2 PIC X.
05 CLI1-FCH-NACA PIC X(02).
03 CLI1-FCH-REG.
05 CLI1-FCH-REGD PIC X(02).
05 CLI1-FCH-REGF1 PIC X.
05 CLI1-FCH-REGM PIC X(02).
05 CLI1-FCH-REGF2 PIC X.
05 CLI1-FCH-REGA PIC X(02).
03 CLI1-PROFESION PIC X(15).
03 CLI1-REGISTRO PIC X(08).
03 CLI1-SEXO PIC X(01).
03 CLI1-TRABAJO PIC X(45).
03 CLI1-DIR-TRA PIC X(55).
03 CLI1-CIU-TRA PIC X(04).
03 CLI1-TEL-TRA PIC X(10).
03 CLI1-SAL-TRA.
05 CLI1-SAL-TRAE PIC X(10).
05 CLI1-SAL-TRAF PIC X.
05 CLI1-SAL-TRAD PIC X(02).
03 CLI1-SAL-ING.
05 CLI1-SAL-INGE PIC X(10).
05 CLI1-SAL-INGF PIC X.
05 CLI1-SAL-INGD PIC X(2).
03 CLI1-LUG-COBRO PIC X(1).

*
WORKING-STORAGE SECTION.
01 VARIABLES.
03 X PIC 99.
03 FECHA PIC 9(6).
03 FECHAR REDEFINES FECHA.
05 DIA PIC 99.
05 MES PIC 99.
05 ANO PIC 99.
03 VALOR PIC 9(9)V99.
03 VALORR REDEFINES VALOR.
05 VAE PIC 9(9).
05 VAD PIC 99.
03 MTO-9 PIC 9(9)V99.
03 PAGADO PIC 9(9)V99.
03 MTO-0 PIC 9999.
PROCEDURE DIVISION.
MAIN SECTION.
1. OPEN INPUT PRECLI OUTPUT PREMAE1.
2. READ PRECLI NEXT RECORD AT END GO 9.
MOVE LOW-VALUES TO REG-PREMAE1.
PERFORM WR-PRECLI.
WRITE REG-PREMAE1.
DISPLAY CLI-KEY.
GO TO 2.
9. CLOSE PREMAE1 PRECLI.
STOP RUN.
WR-PRECLI SECTION.
1. MOVE CLI-KEY TO CLI1-KEY1.
MOVE CLI-NOMBRE TO CLI1-NOMBRE.
MOVE CLI-APELL TO CLI1-APELLIDO.
MOVE CLI-DIRECCION TO CLI1-DIRECCION.
MOVE CLI-CIUDAD TO CLI1-CIUDAD.
MOVE CLI-TELEFONO TO CLI1-TEL-CASA.
MOVE CLI-CEDULA TO CLI1-CIP.
MOVE CLI-EXTEND TO CLI1-EXTENDIDA.
MOVE CLI-FCH-CED TO FECHA.
MOVE DIA TO CLI1-FCH-EXTD.
MOVE MES TO CLI1-FCH-EXTM.
MOVE ANO TO CLI1-FCH-EXTA.
MOVE CLI-SE-LEE TO CLI1-FIRMA-SE-LEE.
MOVE CLI-EST-CIV TO CLI1-EST-CIVIL.
MOVE CLI-EDAD TO CLI1-EDAD.
MOVE CLI-FCH-NAC TO FECHA.
MOVE DIA TO CLI1-FCH-NACD.
MOVE MES TO CLI1-FCH-NACM.
MOVE ANO TO CLI1-FCH-NACA.
MOVE CLI-FCH-REG TO FECHA.
MOVE DIA TO CLI1-FCH-REGD.
MOVE MES TO CLI1-FCH-REGM.
MOVE ANO TO CLI1-FCH-REGA.
MOVE CLI-PROFESION TO CLI1-PROFESION.
MOVE CLI-REGISTRO TO CLI1-REGISTRO.
MOVE CLI-SEXO TO CLI1-SEXO.
MOVE CLI-TRA-LUG TO CLI1-TRABAJO.
MOVE CLI-TRA-DIRECC TO CLI1-DIR-TRA .
MOVE CLI-TRA-CIUDAD TO CLI1-CIU-TRA.
MOVE CLI-TRA-TEL TO CLI1-TEL-TRA.
MOVE CLI-TRA-SAL TO VALOR.
MOVE VAE TO CLI1-SAL-TRAE.
MOVE VAD TO CLI1-SAL-TRAD.
MOVE CLI-TRA-INGR TO VALOR.
MOVE VAE TO CLI1-SAL-INGE.
MOVE VAD TO CLI1-SAL-INGD.
MOVE CLI-LUG-COBRO TO CLI1-LUG-COBRO.

9. EXIT.

wehs

unread,
Dec 16, 2009, 1:58:27 PM12/16/09
to

wow , siglos de no ver este tipo de c�digo, nunca trabaje laboralmente con
el pero si lo vi como parte de una asignatura, jajaja, esto me hace sentir
ya viejo jajajaja.

saludos,


--
Wehs
W Vista Bussines SP2/VFP2 SP2
Stgo. Chile

"josepe" <userzil...@navegante.com.y> escribi� en el mensaje de
noticias news:OOwOA1oe...@TK2MSFTNGP06.phx.gbl...

0 new messages